package com.lineage.server.serverpackets;

public class S_CommonInfo extends ServerBasePacket {
  private byte[] _byte;
  
  public S_CommonInfo(int type, String[] info) {
    this._byte = null;
    buildPacket(type, info);
  }
  
  private void buildPacket(int type, String[] info) {
    writeH(type);
    if (info == null) {
      writeC(0);
    } else {
      writeC(info.length);
      int i = 0;
      while (i < info.length) {
        writeS(info[i]);
        i++;
      } 
    } 
  }
  
  public byte[] getContent() {
    if (this._byte == null)
      this._byte = getBytes(); 
    return this._byte;
  }
  
  public String getType() {
    return getClass().getSimpleName();
  }
}
